import Opt from '@/components/dt/info/Opt.js'
import ruleOpt from '@/biz/option/rule.js'
import nameOpt from '@/biz/option/name.js'

class TransferOpt extends Opt {
  constructor(info) {
    super(info)
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [
      nameOpt.createPeople({
        title: '转交对象',
        key: 'transmitUserId',
        to: (v) => {
          return {
            transmitUserId: v.userId,
            trAuditPeople: v.userName,
            trWorkNo: v.workNo
          }
        },
        rules: [ruleOpt.required('请选择转交对象', 'number')]
      })
    ]
  }
}

export default TransferOpt
